package leetcode.hot100;

import datastruct.tree.TreeNode;

import java.util.ArrayList;
import java.util.List;

public class Solution94 {



    public List<Integer> inorderTraversal(TreeNode root) {
        ArrayList<Integer> total = new ArrayList<>();
        inOrder(root,total);
        return total;
    }

    public void inOrder(TreeNode root, ArrayList<Integer> total){
        if(root==null) return;
        inOrder(root.left,total);
        total.add(root.val);
        inOrder(root.right,total);
    }

}
